import React, { useState } from "react";
import { useLocation } from "react-router-dom";
import { useNavigate } from "react-router-dom";
function List() {
  const location = useLocation();
  const navigate = useNavigate();
  const [data, setdata] = useState(location.state);
  const qvpinglun = () => {
    navigate("/style");
  };
  return (
    <div>
      <img src={data.img} alt="" />
      <span onClick={qvpinglun}>去评论</span>
    </div>
  );
}

export default List;
